﻿<UserControl x:Class="SLExtensions.Showcase.PageAlternateConverter"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:sled="clr-namespace:SLExtensions.Data;assembly=SLExtensions.Data"
    xmlns:scControllers="clr-namespace:SLExtensions.Showcase.Controllers;assembly=SLExtensions.Showcase"
   >
	<UserControl.Resources>
		
        <sled:AlternateBrushConverter x:Key="alternateConverter" />
        
        <sled:AlternateBrushConverterParameter x:Key="alternateParameter" >
            <sled:AlternateBrushConverterParameter.Brushes>
                <SolidColorBrush Color="White"/>
                <LinearGradientBrush StartPoint="0.45666,0.185989" EndPoint="1.22116,0.185989">
                    <LinearGradientBrush.RelativeTransform>
                        <TransformGroup>
                            <SkewTransform CenterX="0.45666" CenterY="0.185989" AngleX="0.135522" AngleY="0"/>
                            <RotateTransform CenterX="0.45666" CenterY="0.185989" Angle="82.8625"/>
                        </TransformGroup>
                    </LinearGradientBrush.RelativeTransform>
                    <GradientStop Color="#80FFFFFF" Offset="0"/>
                    <GradientStop Color="#808C8A8C" Offset="0.62345"/>
                    <GradientStop Color="#8019161A" Offset="1"/>
                </LinearGradientBrush>
                <SolidColorBrush Color="Gainsboro"/>
                <SolidColorBrush Color="#FFDD22"/>
            </sled:AlternateBrushConverterParameter.Brushes>
        </sled:AlternateBrushConverterParameter>
    </UserControl.Resources>
	<StackPanel x:Name="LayoutRoot" Background="White" >
        <TextBlock Text="Alternating brush converter"/>
		<ItemsControl ItemsSource="ABCDEFGH">
			<ItemsControl.ItemTemplate>
				<DataTemplate>
					<Grid Background="{Binding Path='', Converter={StaticResource alternateConverter}, ConverterParameter={StaticResource alternateParameter}}">
						<TextBlock Text="{Binding}" />	
					</Grid>
				</DataTemplate>
			</ItemsControl.ItemTemplate>
		</ItemsControl>

        <ItemsControl ItemsSource="ABCDEFGH" Margin="0,40,0,0">
            <ItemsControl.ItemTemplate>
                <DataTemplate>
                    <Grid Background="{Binding Path='', Converter={StaticResource alternateConverter}, ConverterParameter='White Gray #FFDD22'}">
                        <TextBlock Text="{Binding}" />
                    </Grid>
                </DataTemplate>
            </ItemsControl.ItemTemplate>
        </ItemsControl>
    </StackPanel>
</UserControl>
